<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>AddPlan</title>
<link type="text/css" href="../css/redmond/jquery-ui-1.7.custom.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../css/blueprint/plugins/buttons/screen.css" media="screen, projection"/>
<link rel="stylesheet" href="../css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" />
<script type="text/javascript" src="../script/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../script/jquery-ui-1.7.custom.min.js"></script>
<script type="text/javascript" src="../script/jquery.prettyPhoto.js"></script>
<script type="text/javascript">
	$(document).ready( function() {
		$("#tabs").tabs();
		$(".date-text").datepicker( { dateFormat: 'yy-mm-dd', changeYear: true, changeMonth: true, dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'], monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12']} );

        var planId = '<s:property value="planId" />';
        getPlanDetail(planId);

        $("#PASS_BUTTON").click(function() {
            $.getJSON("PassSubmittedPlan.action", {"planId": planId},
                function(data) {
                    if (data.optRet == "success") {
                        $("#optRet").text("操作成功，已设置方案通过");
                        $("#PASS_BUTTON").attr("disabled", "true");
                    } else {
                        $("#optRet").text("操作不成功，请重试");
                    }
                }
            );
        });

        $("#REJECT_BUTTON").click(function() {
            $.getJSON("RejectSubmittedPlan.action", {"planId": planId},
                function(data) {
                	if (data.optRet == "success") {
                        $("#optRet").text("操作成功，已设置方案返修");
                        $("#REJECT_BUTTON").attr("disabled", "true");
                    } else {
                        $("#optRet").text("操作不成功，请重试");
                    }
                }
            );
        });

        $("#DELETE_BUTTON").click(function() {
            if (confirm("确定要删除方案吗?")) {
            	$.getJSON("DeleteSubmittedPlan.action", {"planId": planId},
                    function(data) {
                        if (data.optRet == "success") {
                            $("#optRet").text("操作成功，已删除方案");
                            $("#PASS_BUTTON").attr("disabled", "true");
                            $("#REJECT_BUTTON").attr("disabled", "true");
                            $("#DELETE_BUTTON").attr("disabled", "true");
                        } else {
                            $("#optRet").text("操作不成功，请重试");
                        }
                    }
                );
            }
        });
	});

	function getPlanDetail(planId) {
        $.getJSON("SubmittedPlanDetail.action", {"planId": planId},
       		function(data) {
	            // 基本信息
	            if (data.planDetail.main != null) {
	                $("#XMDJH").text(data.planDetail.main.registerid);
	                $("#XMZT").text(data.planDetail.main.stateid);
	                $("#XMSZD").text(data.planDetail.main.registerid);// TODO
	                $("#XMDW").text(unescape(data.planDetail.main.prjUnit));
	                $("#XMMC").text(unescape(data.planDetail.main.prjName));
	                $("#XMXZ").text(unescape(data.planDetail.main.prjXmxzName));
	                $("#KCFS").text(unescape(data.planDetail.main.prjKcfsName));
	                $("#XMGM").text(data.planDetail.main.prjXmgm);
	                $("#KZ").text(unescape(data.planDetail.main.prjKzName));
	            }
	            
	            // 破坏类型
	            if (data.planDetail.xmqntdphlx != null) {
	                $("#YPHWSMJ").text(data.planDetail.xmqntdphlx.yphwsmj);
	                $("#NPHWSMJ").text(data.planDetail.xmqntdphlx.nphwsmj);
	                $("#YPHTXMJ").text(data.planDetail.xmqntdphlx.yphtxmj);
	                $("#NPHTXMJ").text(data.planDetail.xmqntdphlx.nphtxmj);
	                $("#YPHYZMJ").text(data.planDetail.xmqntdphlx.yphyzmj);
	                $("#NPHYZMJ").text(data.planDetail.xmqntdphlx.nphyzmj);
	                $("#YPHWRMJ").text(data.planDetail.xmqntdphlx.yphwrmj);
	                $("#NPHWRMJ").text(data.planDetail.xmqntdphlx.nphwrmj);
	            }
	
	            // 生产项目概况
	            if (data.planDetail.scxmgk != null) {
	                $("#YJJSYD").text(data.planDetail.scxmgk.yjjsyd);
	                $("#PHTDMJ").text(data.planDetail.scxmgk.phtdmj);
	                $("#ZYZCL").text(data.planDetail.scxmgk.zyzcl);
	                $("#SCNL").text(data.planDetail.scxmgk.scnl);
	                $("#SCSTART_YEAR").text(data.planDetail.scxmgk.startYear);
	                $("#SCEND_YEAR").text(data.planDetail.scxmgk.endYear);
	            }
	
	            // 预期复垦面积
	            if (data.planDetail.yqfkmj != null) {
	                $("#GDMJ").text(data.planDetail.yqfkmj.gdmj);
	                $("#YDMJ").text(data.planDetail.yqfkmj.ydmj);
	                $("#LDMJ").text(data.planDetail.yqfkmj.ldmj);
	                $("#MCDMJ").text(data.planDetail.yqfkmj.mcdmj);
	                $("#QTNYDMJ").text(data.planDetail.yqfkmj.qtnydmj);
	                $("#JSYDMJ").text(data.planDetail.yqfkmj.jsydmj);
	                $("#TDFKL").text(data.planDetail.yqfkmj.tdfkl);
	            }
	            
	            // 项目区土地利用现状
	            if (data.planDetail.xmqtdlyxz != null) {
	                $("#YPHGDMJ").text(data.planDetail.xmqtdlyxz.yphgdmj);
	                $("#NPHGDMJ").text(data.planDetail.xmqtdlyxz.nphgdmj);
	                $("#YPHYDMJ").text(data.planDetail.xmqtdlyxz.yphydmj);
	                $("#NPHYDMJ").text(data.planDetail.xmqtdlyxz.nphydmj);
	                $("#YPHLDMJ").text(data.planDetail.xmqtdlyxz.yphldmj);
	                $("#NPHLDMJ").text(data.planDetail.xmqtdlyxz.nphldmj);
	                $("#YPHMCDMJ").text(data.planDetail.xmqtdlyxz.yphmcdmj);
	                $("#NPHMCDMJ").text(data.planDetail.xmqtdlyxz.nphmcdmj);
	                $("#YPHQTNYDMJ").text(data.planDetail.xmqtdlyxz.yphqtnydmj);
	                $("#NPHQTNYDMJ").text(data.planDetail.xmqtdlyxz.nphqtnydmj);
	                $("#YPHJSYDMJ").text(data.planDetail.xmqtdlyxz.yphjsydmj);
	                $("#NPHJSYDMJ").text(data.planDetail.xmqtdlyxz.nphjsydmj);
	                $("#YPHWLYDMJ").text(data.planDetail.xmqtdlyxz.yphwlydmj);
	                $("#NPHWLYDMJ").text(data.planDetail.xmqtdlyxz.nphwlydmj);
	            }
	
	            // 投资
	            if (data.planDetail.invest != null) {
	                $("#TDFKTZGS").text(data.planDetail.invest.tdfktzgs);
	                $("#DWMJTZGS").text(data.planDetail.invest.dwmjtzgs);
	            }
	
	            // 编制单位
	            if (data.planDetail.unit != null) {
	                $("#DWMC").text(unescape(data.planDetail.unit.cuName));
	                $("#LXR").text(data.planDetail.unit.cuContact);
	                $("#LXDH").text(data.planDetail.unit.cuPhone);
	            }

	            // 专家
	            /*
                if (data.planDetail.experts != null) {
                    $("#expert0Name").text(data.planDetail.experts.expert0Name == null ? '' : unescape(data.planDetail.experts.expert0Name));
                    $("#expert1Name").text(data.planDetail.experts.expert1Name == null ? '' : unescape(data.planDetail.experts.expert1Name));
                    $("#expert2Name").text(data.planDetail.experts.expert2Name == null ? '' : unescape(data.planDetail.experts.expert2Name));
                    $("#expert3Name").text(data.planDetail.experts.expert3Name == null ? '' : unescape(data.planDetail.experts.expert3Name));
                    $("#expert4Name").text(data.planDetail.experts.expert4Name == null ? '' : unescape(data.planDetail.experts.expert4Name));
                    $("#expert5Name").text(data.planDetail.experts.expert5Name == null ? '' : unescape(data.planDetail.experts.expert5Name));
                    $("#expert6Name").text(data.planDetail.experts.expert6Name == null ? '' : unescape(data.planDetail.experts.expert6Name));
                    $("#expert7Name").text(data.planDetail.experts.expert7Name == null ? '' : unescape(data.planDetail.experts.expert7Name));
                    $("#expert8Name").text(data.planDetail.experts.expert8Name == null ? '' : unescape(data.planDetail.experts.expert8Name));
                }
                */

	            // 方案附件
	            if (data.planDetail.fafjList != null) {
	                for (var i = 0; i < data.planDetail.fafjList.length; i++) {
	                	if (data.planDetail.fafjList[i].type == "F") {
	                    	$("#fafj_ul").append('<li style="list-style-type:none;"><img src="../images/page_white_word.png"/><a href="' + data.planDetail.fafjList[i].url + '">' + data.planDetail.fafjList[i].fjName + '</a></li>');
	                    }
	                    if (data.planDetail.fafjList[i].type == "S") {
	                    	$("#slfj_ul").append('<li style="list-style-type:none;"><img src="../images/page_white_word.png"/><a href="' + data.planDetail.fafjList[i].url + '">' + data.planDetail.fafjList[i].fjName + '</a></li>');
	                    }
	                    if (data.planDetail.fafjList[i].type == "Y") {
	                    	$("#yjfj_ul").append('<li style="list-style-type:none;"><img src="../images/page_white_word.png"/><a href="' + data.planDetail.fafjList[i].url + '">' + data.planDetail.fafjList[i].fjName + '</a></li>');
	                    }
	                }
	            }

	            //典型图片
	            if (data.planDetail.dxtpList != null) {
	                var strArr = new Array();
	                for (var j = 0; j < data.planDetail.dxtpList.length; j++) {
	                	strArr.push('<li style="list-style-type:none;float:left;padding: 10px"><a href="' + data.planDetail.dxtpList[j].url + '" rel="prettyPhoto[gallery]"><img width="100" height="100" src="' + data.planDetail.dxtpList[j].url + '"/></a></li>');
	                }
	                $("#dxtp_submitted_list").html(strArr.join(''));
	                $("a[rel^='prettyPhoto']").prettyPhoto(); 
	            }
	        }
        );
    }
</script>
<style type="text/css">
    .ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .1em .1em 0; font-size: 0.9em;}
    button {
    	font-size: 75%;
    }
</style>
</head>
<body>
<div id="tabs" style="padding: 0px; margin: 0px; width: 100%; border: none 0px;">
    <ul>
        <li><a href="#tabs-1">基本信息</a></li>
        <li><a href="#tabs-5">破坏类型</a></li>
        <li><a href="#tabs-6">项目概况</a></li>
        <li><a href="#tabs-7">预期复垦面积</a></li>
        <li><a href="#tabs-8">利用现状</a></li>
        <li><a href="#tabs-9">复垦投资</a></li>
        <li><a href="#tabs-4">附件</a></li>
        <li><a href="#tabs-2">编制单位</a></li>
        <li><a href="#tabs-10">典型图片</a></li>
    </ul>
    <div id="tabs-1">
        <table width="98%" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td width="20%" colspan="4"><div align="center">方案信息</div></td>
            </tr>
            <tr>
                <td width="20%" height="25"><div align="right">项目登记号：</div></td>
                <td width="30%"><span id="XMDJH"></span></td>
                <td width="20%" height="25"><div align="right">项目状态：</div></td>
                <td width="30%"><span id="XMZT"></span></td>
            </tr>
            <tr>
                <td width="20%" style="height: 19px"><div align="right">项目所在地：</div></td>
                <td width="30%" style="height: 19px"><span id="XMSZD"></span></td>
                <td width="20%" style="height: 19px"><div align="right">项目单位：</div></td>
                <td width="30%" style="height: 19px"><span id="XMDW"></span></td>
            </tr>
            <tr>
                <td width="20%" height="25"><div align="right">项目名称：</div></td>
                <td width="30%"><span id="XMMC"></span></td>
                <td width="20%" height="25"><div align="right">项目性质：</div></td>
                <td width="30%"><span id="XMXZ"></span></td>
            </tr>
            <tr>
                <td width="20%" height="25"><div align="right">开采方式：</div></td>
                <td width="30%"><span id="KCFS"></span></td>
                <td width="20%" height="25"><div align="right">项目规模：</div></td>
                <td width="30%"><span id="XMGM"></span></td>
            </tr>
            <tr>
                <td width="20%"><div align="right">矿种：</div></td>
                <td width="30%"><span id="KZ"></span></td>
                <td width="20%" height="25">&nbsp;</td>
                <td width="30%">&nbsp;</td>
            </tr>
        </table>
    </div>
    <div id="tabs-2">
        <table width="100%" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td width="20%" colspan="4"><div align="center">方案编制单位</div></td>
            </tr>
            <tr>
                <td width="20%" style="height: 33px"><div align="right">单位名称：</div></td>
                <td width="30%" style="height: 33px"><span id="DWMC"></span></td>
                <td width="20%" style="height: 33px"><div align="right">联系人：</div></td>
                <td width="30%" style="height: 33px"><span id="LXR"></span></td>
            </tr>
            <tr>
                <td height="25" width="20%"><div align="right">联系电话：</div></td>
                <td width="30%"><span id="LXDH"></span></td>
                <td height="25" width="20%">&nbsp;</td>
                <td width="30%">&nbsp;</td>
            </tr>
            <tr>
                <td height="25" width="20%">&nbsp;</td>
                <td width="30%">&nbsp;</td>
                <td height="25" width="20%">&nbsp;</td>
                <td width="30%">&nbsp;</td>
            </tr>
        </table>
    </div>
    <div id="tabs-4">
		<table width="100%" align="center" cellpadding="0" cellspacing="0">
		    <tr>
                <td width="20%" colspan="4"><div align="center">附件</div></td>
            </tr>
			<tr>
				<td height="25" style="width: 30%"><div align="right">项目方案附件：</div></td>
				<td height="25"><div><ul id="fafj_ul"></ul></div></td>
			</tr>
			<tr>
				<td height="25" width="30%"><div align="right">项目受理附件：</div></td>
				<td height="25"><div><ul id="slfj_ul"></ul></div></td>
			</tr>
			<tr>
				<td width="30%"><div align="right">评审意见附件：</div></td>
				<td height="25"><div><ul id="yjfj_ul"></ul></div></td>
			</tr>
		</table>
	</div>
    <div id="tabs-5">
        <table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tr>
                <td width="20%" colspan="4"><div align="center">项目区内土地破坏类型</div></td>
            </tr>
            <tr>
                <td align="right" style="width: 30%; height: 25px;">已破坏挖损面积：</td>
                <td style="height: 25px"><span id="YPHWSMJ"></span></td>
            </tr>
            <tr>
                <td align="right" style="width: 30%; height: 25px;">拟破坏挖损面积：</td>
                <td style="height: 25px"><span id="NPHWSMJ"></span></td>
            </tr>
            <tr>
                <td height="25" align="right" style="width: 30%">已破坏塌陷面积：</td>
                <td height="25"><span id="YPHTXMJ"></span></td>
            </tr>
            <tr>
                <td height="25" align="right" style="width: 30%">拟破坏塌陷面积：</td>
                <td height="25"><span id="NPHTXMJ"></span></td>
            </tr>
            <tr>
                <td height="25" align="right" style="width: 30%">已破坏压占面积：</td>
                <td height="25"><span id="YPHYZMJ"></span></td>
            </tr>
            <tr>
                <td height="25" align="right" style="width: 30%">拟破坏压占面积：</td>
                <td height="25"><span id="NPHYZMJ"></span></td>
            </tr>
            <tr>
                <td align="right" style="width: 30%; height: 25px;">已破坏污染面积：</td>
                <td style="height: 25px"><span id="YPHWRMJ"></span></td>
            </tr>
            <tr>
                <td height="25" align="right" style="width: 30%">拟破坏污染面积：</td>
                <td height="25"><span id="NPHWRMJ"></span></td>
            </tr>
        </table>
    </div>
    <div id="tabs-6">
        <table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tr>
                <td width="20%" colspan="4"><div align="center">生产项目概况</div></td>
            </tr>
            <tr>
                <td width="30%" align="right" style="height: 25px">永久建设用地：</td>
                <td style="height: 25px"><span id="YJJSYD"></span></td>
            </tr>
            <tr>
                <td width="30%" align="right" style="height: 25px">破坏土地面积：</td>
                <td style="height: 25px"><span id="PHTDMJ"></span></td>
            </tr>
            <tr>
                <td width="30%" align="right" style="height: 25px">资源总储量：</td>
                <td style="height: 25px"><span id="ZYZCL"></span></td>
            </tr>
            <tr>
                <td height="25" width="30%" align="right">生产能力：</td>
                <td height="25"><span id="SCNL"></span></td>
            </tr>
            <tr>
                <td height="25" width="30%" align="right">生产起始年限：</td>
                <td height="25"><span id="SCSTART_YEAR"></span></td>
            </tr>
            <tr>
                <td height="25" width="30%" align="right">生产结束年限：</td>
                <td height="25"><span id="SCEND_YEAR"></span></td>
            </tr>
        </table>
    </div>
    <div id="tabs-7">
        <table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tr>
                <td width="20%" colspan="4"><div align="center">预期复垦面积</div></td>
            </tr>
            <tr>
                <td width="30%" align="right" style="height: 25px">耕地面积：</td>
                <td style="height: 25px"><span id="GDMJ"></span></td>
            </tr>
            <tr>
                <td height="25" width="30%" align="right">园地面积：</td>
                <td height="25"><span id="YDMJ"></span></td>
            </tr>
            <tr>
                <td height="25" width="30%" align="right">林地面积：</td>
                <td height="25"><span id="LDMJ"></span></td>
            </tr>
            <tr>
                <td height="25" width="30%" align="right">牧草地面积：</td>
                <td height="25"><span id="MCDMJ"></span></td>
            </tr>
            <tr>
                <td width="30%" align="right" style="height: 25px">其他农用地面积：</td>
                <td style="height: 25px"><span id="QTNYDMJ"></span></td>
            </tr>
            <tr>
                <td width="30%" align="right" style="height: 25px">建设用地面积：</td>
                <td style="height: 25px"><span id="JSYDMJ"></span></td>
            </tr>
            <tr>
                <td height="25" width="30%" align="right">土地复垦率：</td>
                <td height="25"><span id="TDFKL"></span></td>
            </tr>
        </table>
    </div>
    <div id="tabs-8">
		<table cellspacing="0" cellpadding="0" width="100%" border="0">
			<tr>
				<td width="20%" colspan="4"><div align="center">项目区土地利用现状</div></td>
			</tr>
			<tr>
				<td height="25" width="30%" align="right">已破坏耕地面积：</td>
				<td height="25" style="width: 448px"><span id="YPHGDMJ"></span></td>
			</tr>
			<tr>
				<td height="25" width="30%" align="right">拟破坏耕地面积：</td>
				<td height="25" style="width: 448px"><span id="NPHGDMJ"></span></td>
			</tr>
			<tr>
				<td height="25" width="30%" align="right">已破坏园地面积：</td>
				<td height="25" style="width: 448px"><span id="YPHYDMJ"></span></td>
			</tr>
			<tr>
				<td width="30%" align="right" style="height: 25px">拟破坏园地面积：</td>
				<td style="width: 448px; height: 25px"><span id="NPHYDMJ"></span></td>
			</tr>
			<tr>
				<td height="25" width="30%" align="right">已破坏林地面积：</td>
				<td height="25" style="width: 448px"><span id="YPHLDMJ"></span></td>
			</tr>
			<tr>
				<td width="30%" align="right" style="height: 25px">拟破坏林地面积：</td>
				<td style="height: 25px; width: 448px;"><span id="NPHLDMJ"></span></td>
			</tr>
			<tr>
				<td height="25" width="30%" align="right">已破坏牧草地面积：</td>
				<td height="25" style="width: 448px"><span id="YPHMCDMJ"></span></td>
			</tr>
			<tr>
				<td height="25" width="30%" align="right">拟破坏牧草地面积：</td>
				<td height="25" style="width: 448px"><span id="NPHMCDMJ"></span></td>
			</tr>
			<tr>
				<td height="25" width="30%" align="right">已破坏其他农用地面积：</td>
				<td height="25" style="width: 448px"><span id="YPHQTNYDMJ"></span></td>
			</tr>
			<tr>
				<td height="25" width="30%" align="right">拟破坏其他农用地面积：</td>
				<td height="25" style="width: 448px"><span id="NPHQTNYDMJ"></span></td>
			</tr>
			<tr>
				<td width="30%" align="right" style="height: 25px">已破坏建设用地面积：</td>
				<td style="height: 25px; width: 448px;"><span id="YPHJSYDMJ"></span></td>
			</tr>
			<tr>
				<td width="30%" align="right" style="height: 25px">拟破坏建设用地面积：</td>
				<td style="height: 25px; width: 448px;"><span id="NPHJSYDMJ"></span></td>
			</tr>
			<tr>
				<td height="25" width="30%" align="right">已破坏未利用地面积：</td>
				<td height="25" style="width: 448px"><span id="YPHWLYDMJ"></span></td>
			</tr>
			<tr>
				<td height="25" width="30%" align="right">拟破坏未利用地面积：</td>
				<td height="25" style="width: 448px"><span id="NPHWLYDMJ"></span></td>
			</tr>
		</table>
    </div>
    <div id="tabs-9">
		<table cellspacing="0" cellpadding="0" width="100%" border="0">
			<tr>
				<td height="25" width="30%" align="right">土地复垦投资估算</td>
				<td height="25" width="*"><span id="TDFKTZGS"></span>万元(人民币)</td>
			</tr>
			<tr>
				<td height="25" width="30%" align="right">单位面积投资估算</td>
				<td height="25" width="*"><span id="DWMJTZGS"></span>万元/公顷</td>
			</tr>
		</table>
	</div>
	<div id="tabs-10">
		<table width="100%" align="left" cellpadding="2" cellspacing="2">
            <tr>
                <td align="center" colspan="3">典型图片</td>
            </tr>
            <tr>
            	<td colspan="3"><div style="width:500px;"><ul id="dxtp_submitted_list"></ul></div></td>
            </tr>
        </table>
    </div>
</div>
<div style="height: 120%">
	<button type="button" id="PASS_BUTTON"><img src="../css/blueprint/plugins/buttons/icons/tick.png" alt=""/>通过</button>
    <button type="button" id="REJECT_BUTTON"><img src="../css/blueprint/plugins/buttons/icons/cross.png" alt=""/>返修</button>
    <button type="button" id="DELETE_BUTTON"><img src="../css/blueprint/plugins/buttons/icons/delete.png" alt=""/>删除</button>
    <span id="optRet" style="background-color: #fff1a8; font-weight:bold; font-size: 80%;"></span>
</div>
</body>
</html>